<?php
import("data.db.DbAbstractTable");

class DbDocLink extends DbAbstractTable {
	public $className = "data.logic.file.DocLink";
	const CLASS_NAME = "data.logic.file.DocLink";
	
	const TB_TABLENAME	= "pd_doc_storage";
	const TB_I			= 'dst';
	
	const TB_DOC		= 'dst_id_fdoc';
	const TB_STORAGE	= 'dst_id_strg';
	
	public static function _get_TABLENAME() {return self::TB_TABLENAME;}
	public static function _get_ID() {return self::TB_I."_id";}
	public static function _get_SUFFIX() {return self::TB_I;}
	
	function forwardForeignCollection() {
		return array(
			"DocInfo"=>"data.logic.file.DocInfo",
			"Storage"=>"data.logic.file.StorageInfo"
		);
	}
	
	function backwardForeignCollection() {
		return parent::backwardForeignCollection();
	}
	
	function setDocInfo(&$obj) {
		$this->forwardForeigns["DocInfo"]->setForeign($obj);
	}
	function &getDocInfo() {
		return $this->forwardForeigns["DocInfo"]->getForeign();
	}
	
	function setStorageInfo(&$obj) {
		$this->forwardForeigns["Storage"]->setForeign($obj);
	}
	function &getStorageInfo() {
		return $this->forwardForeigns["Storage"]->getForeign();
	}
	
	// same for all classes
    public static function findAll() {return DbAbstractTable::findAll(self::CLASS_NAME);}
    public static function findById($id) {return DbAbstractTable::findById($id, self::CLASS_NAME);}
}
?>